﻿using System.Data.Entity.ModelConfiguration;
using RookieGrow.Domain.Model.SportsStore;

namespace RookieGrow.Data.SportsStore.Map
{
    public class ProductMap : EntityTypeConfiguration<Product>
    {
        public ProductMap()
        {
            Property(d => d.ProductID).IsRequired();

            // Table & Column Mappings
            this.ToTable("product");
            this.Property(t => t.ProductID).HasColumnName("id");
            this.Property(t => t.Name).HasColumnName("name");
            this.Property(t => t.Description).HasColumnName("description");
            this.Property(t => t.Price).HasColumnName("price");
            this.Property(t => t.Category).HasColumnName("category");
        }
    }
}
